package com.marsoft.test.entity;


import com.marsoft.test.validation.DateValue;
import com.marsoft.test.validation.ValidationGroups;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MaximumAmountControllerEntity {

    /**
     * 当前页码
     */
    private Integer page = 1;

    /**
     *担保类型(0.一般担保,1.最高额担保担保)
     */
    @NotNull(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "担保类型不能为空")
    private Integer guarantyType;

    /**
     * 担保合同号
     */
    private String guarantyContractNo;

    /**
     * 担保方式(0.抵押1.质押2.保证)
     */
    @NotNull(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "担保方式不能为空")
    private Integer guarantyStyle;

    /**
     * 担保人姓名
     */
    @NotEmpty(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "担保人姓名不能为空")
    private String guarantyUsername;

    /**
     * 担保金额
     */
    private String guarantyAmount;

    /**
     * 担保合同状态(0代表有效，1代表无效)
     */
    private Integer guarantyContractStatus;

    /**
     * 合同签订日期
     */
    @NotEmpty(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "合同签订日期不能为空")
    @DateValue(groups = {ValidationGroups.SaveMaximumGuaranty.class}, format = "yyyy/MM/dd",message = "请输入正确的日期格式")
    private String contStartDate;

    /**
     * 合同生效日期
     */
    @NotEmpty(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "合同生效日期不能为空")
    @DateValue(groups = {ValidationGroups.SaveMaximumGuaranty.class}, format = "yyyy/MM/dd",message = "请输入正确的日期格式")
    private String contEffectDate;

    /**
     * 到期日期
     */
    @NotEmpty(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "到期日期不能为空")
    @DateValue(groups = {ValidationGroups.SaveMaximumGuaranty.class}, format = "yyyy/MM/dd",message = "请输入正确的日期格式")
    private String endDate;

    /**
     * 币种
     */
    private String moneyType;

    /**
     * 证件编号
     */
    private String idNo;

    /**
     * 证件类型（身份证号）
     */
    private String idType;

    /**
     * 担保总金额
     */
    @NotEmpty(groups = {ValidationGroups.SaveMaximumGuaranty.class}, message = "担保总金额不能为空")
    @Pattern(groups = {ValidationGroups.SaveMaximumGuaranty.class}, regexp = "^(([[1-9]0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,2})))$", message = "请填写正确的金额")
    private String guarantySumMoney;

    /**
     * 逻辑删除(0.删除1.未删除)
     */
    private Integer logicDelete;

    /**
     * 担保合同余额
     */
    private String guarantyBalance;

    /**
     * 登记机构
     */
    private String registrationAgencies;

    /**
     * 登记人
     */
    private String registrant;

    /**
     * 登记日期
     */
    private String recordDate;

    /**
     * 更新人
     */
    private String updateName;

    /**
     * 更新日期
     */
    private String updateDate;

    /**
     * 合同编号
     */
    private Integer contractNo;

}
